let botApp = {
  template: `
  <div class="foot_bg">
			<div class="content clear">
				<div class="foot_left">
					<img src="images/logo02.png" alt="">
					<div class="foot_txt">
						Telephone: {{site.company_phone}}<br>
						Address: {{site.company_address}}<br>
						E-mail: {{site.company_email}}
					</div>
				</div>
				<div class="foot_nav pc">
					<ul>
          <template v-for="(item,index) in navList">
						<li v-if="index > 0">
							<h1><a :href="item.link+'&nav_id='+item.id">{{item.title}}</a><img src="images/arrow.png" alt="" v-if="item.id == '652c86d5a0cccc308d4e71bf'"></h1>
							<ul v-if="item.id == '652c86d5a0cccc308d4e71bf'">

								<li v-for="it in type"><a :href="'product.html?category_id=65372a43f5cb1f54e276a5e6&type_id='+it.id+'&nav_id=652c86d5a0cccc308d4e71bf'">{{it.title}}</a></li>
								<li><a href="product.html?category_id=653c5e941cf47d54385b2915&nav_id=652c86d5a0cccc308d4e71bf&ac=0">See all categories</a></li>
                
							</ul>
						</li>
          </template>
					</ul>
				</div>
			</div>
			<div class="copyright">{{site.company_desc}}  <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">{{site.company_keep}}</a></div>
		</div>
`,
  setup() {

    let site = Vue.ref([]);//站点信息
    let navList = Vue.ref([]);//导航
    let type = Vue.ref([])  //分类
    let xcxewm = Vue.ref({}) //小程序二维码
    const getsite = () => {
      requestData('site', null, (res) => {
        // res 数据
        //console.log(res);
        site.value = res
      })
    }

    const getNav = () => {
      requestData('navigation', {
        data_type: 'list',
        limit: '6',
        list_type: 'children',
        sort: 'sortAsc',
        category_id: "0"
      }, (res) => {
        // res 根据条件筛选的数据
        //console.log(res);
        navList.value = res
      })
    }

    // 分类
    const gettype = () => {
      requestData('category', {
          data_type: 'list',
          list_type: 'children',
          limit: '5',
          //category_id: '65372a43f5cb1f54e276a5e6',
          category_id: '0',
          sort: 'sortAsc',
          type: 'goods',
      }, function (res) {
        //console.log(res);
        type.value = res
      })
    }

    // 小程序二维码
    const getxcxewm = () => {
      requestData('text', {
        data_type: 'show',
        id: '650964e08c2a3959034b3be1',
      }, (res) => {
        //console.log(res.sjewm.details);

        xcxewm.value = res.info

      })
    }

    Vue.onBeforeMount(() => {
    })
    Vue.onMounted(() => {
      getsite()
      getNav()
      gettype()
      getxcxewm()
    })
    return { site, navList, type, xcxewm }
  }
}
